<template>
  <div>
    <a-drawer
        :width="500"
        :visible="userStore.visible"
        unmountOnClose
        :footer="false"
        @cancel="handelClose"
    >
      <template #title>
        {{ userStore.judgeBool ? '编辑角色' : '新建角色' }}
      </template>
      <div v-if="userStore.judgeBool">
        <EditRole/>
      </div>
      <div v-else>
        <AddRole/>
      </div>
    </a-drawer>
  </div>

</template>

<script lang="ts" setup>
import {useUser} from "../../../store/user";
import AddRole from "./AddRole.vue";
import EditRole from "./EditRole.vue";

const userStore = useUser()

const handelClose = () => {
  userStore.visible = false
}

</script>

<style scoped>

</style>